package com.project.harmonyledger.controller.account;

import com.project.harmonyledger.common.response.Result;
import com.project.harmonyledger.service.user.account.InfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/api/user")
public class InfoController {
  @Autowired
  private InfoService infoService;

  @GetMapping("/getInfo")
  public Result<Map<String, String>> getInfo() {
    return infoService.getInfo();
  }

  @PutMapping("/updateUserInfo")
  public Result<Map<String, String>> updateUserInfo(
      @RequestParam(required = false) String nickname,
      @RequestParam(required = false) String photo) {
    return infoService.updateUserInfo(nickname, photo);
  }
}
